package org.melanesia.beans.validation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * Annotation used to mark bean properties for validation.
 *
 * @author marcin.kielar
 *
 */
@Retention(RetentionPolicy.RUNTIME)
@Target({ ElementType.METHOD, ElementType.FIELD })
public @interface ValidationRules {

    /**
     * Determines whether the value of the property should be validated for null.
     */
    boolean nullable() default true;

    /**
     * Allows for custom validator definition for a property.
     */
    Class<? extends Validator> validator() default Validator.class;
}